package com.dxg.msns.common.pojo;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;

/**
 * 管理员实体类
 * 对应数据库表：admin
 * 
 * @author system
 */
@Table(name = "admin")
public class Admin implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID自增
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 管理员ID
     */
    @Column(name = "adminId")
    private String adminId;

    /**
     * 管理员昵称
     */
    @Column(name = "aname")
    private String aname;

    /**
     * 管理员性别
     */
    @Column(name = "sex")
    private String sex;

    /**
     * 管理员生日
     */
    @Column(name = "birthday")
    private Date birthday;

    /**
     * 管理员手机
     */
    @Column(name = "phone")
    private String phone;

    /**
     * 管理员邮箱
     */
    @Column(name = "email")
    private String email;

    /**
     * 管理员密码
     */
    @Column(name = "apassword")
    private String apassword;

    /**
     * 状态
     */
    @Column(name = "status")
    private String status;

    // 构造方法
    public Admin() {
    }

    public Admin(String adminId, String aname, String apassword) {
        this.adminId = adminId;
        this.aname = aname;
        this.apassword = apassword;
        this.status = "1";
    }

    // Getter 和 Setter 方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAdminId() {
        return adminId;
    }

    public void setAdminId(String adminId) {
        this.adminId = adminId;
    }

    public String getAname() {
        return aname;
    }

    public void setAname(String aname) {
        this.aname = aname;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getApassword() {
        return apassword;
    }

    public void setApassword(String apassword) {
        this.apassword = apassword;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "id=" + id +
                ", adminId='" + adminId + '\'' +
                ", aname='" + aname + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday=" + birthday +
                ", phone='" + phone + '\'' +
                ", email='" + email + '\'' +
                ", apassword='" + apassword + '\'' +
                ", status='" + status + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Admin admin = (Admin) o;

        return adminId != null ? adminId.equals(admin.adminId) : admin.adminId == null;
    }

    @Override
    public int hashCode() {
        return adminId != null ? adminId.hashCode() : 0;
    }
}